Flip margin-start and -end in RTL
authorMatthias Clasen <mclasen@redhat.com>
Fri, 15 Jan 2021 19:56:21 +0000 (14:56 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 15 Jan 2021 19:58:21 +0000 (14:58 -0500)
We lost this at some point, but the widget margins
are still meant to be relative to the text direction.

Fixes: #3583
gtk/gtkwidget.c

index 6efcdccc4a9ce812bdce84e265724e68f710b3cd..45a3720b18dd7bc22f1a30d97e08905703619974 100644 (file)
@@ -3900,7 +3900,10 @@ gtk_widget_allocate (GtkWidget    *widget,
   priv->allocated_height = height;
   priv->allocated_size_baseline = baseline;
 
-  adjusted.x = priv->margin.left;
+  if (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+    adjusted.x = priv->margin.left;
+  else
+    adjusted.x = priv->margin.right;
   adjusted.y = priv->margin.top;
   adjusted.width = width - priv->margin.left - priv->margin.right;
   adjusted.height = height - priv->margin.top - priv->margin.bottom;